<include file="Public:header" />



<div class="tools"> 

<div class="add"><span><a href="{:U('content/editanli')}">添加</a></span></div>

<!--<div class="del"><span><span><a href="javascript:void(0);" onclick="del();">删除</a></span></div>
-->

<div class="add"><span><span><a href="javascript:void(0);" onclick="tui();">推至首页</a></span></div>
<div class="del"><span><span><a href="javascript:void(0);" onclick="qutui();">取消推至首页</a></span></div>

<div class="add"><span><span><a href="{:U('content/daochukehu')}" target="_blank">导出excel</a></span></div>

</div>

<div class="content">

<!-----------------------------------------内容开始--------------------------------------------------->

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabBox">

<tr class="tabTitleMain">

    <td width="5%" class="selectAll"><a href="javascript:;" id="selall">全选</a></td>

    <td width="5%">ID号</td>

    <td width="10%">客户姓名</td>

    <td width="10%">联系电话</td>

    <td width="12%">意向型号</td>
	
    <td width="5%">首页公示</td>

    <td width="8%">操作</td>

</tr>





<volist name='list' id='l'>

<tr class="tabTextMain" id="From_1" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#fbf435';">

  <td><input type="checkbox" name="ids" id="ids" value="{$l.id}"></td>

  <td>{$l.id}</td>

  <td>{$l.name}</td>

  <td>{$l.dianhua}</td>

  <td>{$l.fenlei}</td>
  
  <td>{$l.zhuangtai}</td>

  <td><a href="{:U('content/editanli',array(id=>$l[id]))}">修改</a>|<a href="javascript:;" onclick="del({$l.id});">删除</a></td>

</tr>

</volist>

  

</table> 

<div class="page">{$page}</div>

<!-----------------------------------------内容结束--------------------------------------------------->

</div>

<script type="text/javascript">   

$(function() {   

$("#selall").toggle(function() {   

     $("input[name='ids']").each(function() {   

     $(this).attr("checked", true); 

     });

},function(){

	 $("input[name='ids']").each(function() {   

     $(this).attr("checked", false); 

     }); 

});



});

function del(kid){

kid = kid ? kid : getChecked();

kid = kid.toString();

if(kid == ''){

	ui.error('你没有选择任何选项！');

	return false;

}

if(!confirm('删除后无法恢复，确定删除？'))

	return false;



$.post("{:U('content/delanli')}", {ids:kid}, function(v){

	if( v == 1 ){

		ui.success('删除成功！');

		location.reload("{:U('content/anli')}");

	}else{

		ui.error('删除失败！');

	}

});

} 
function daochukehu(){

	
	$.post("{:U('content/daochukehu')}", {}, function(v){
	
		if( v == 1 ){
	
			ui.success('导出成功！');
	
			//location.reload("{:U('content/anli')}");
	
		}else{
	
			ui.error('导出失败！');
	
		}
	
	});

} 
function tui(kid){

	kid = kid ? kid : getChecked();
	
	kid = kid.toString();
	
	if(kid == ''){
	
		ui.error('你没有选择任何选项！');
	
		return false;
	
	}
	
	
	
	$.post("{:U('content/tuianli')}", {ids:kid}, function(v){
	
		if( v == 1 ){
	
			ui.success('推至首页成功！');
	
			location.reload("{:U('content/anli')}");
	
		}else{
	
			ui.error('推至首页失败！');
	
		}
	
	});

} 
function qutui(kid){

	kid = kid ? kid : getChecked();
	
	kid = kid.toString();
	
	if(kid == ''){
	
		ui.error('你没有选择任何选项！');
	
		return false;
	
	}
	
	
	
	$.post("{:U('content/qutuianli')}", {ids:kid}, function(v){
	
		if( v == 1 ){
	
			ui.success('取消成功！');
	
			location.reload("{:U('content/anli')}");
	
		}else{
	
			ui.error('取消失败！');
	
		}
	
	});

} 



function getChecked() {

var gids = new Array();

$.each($('input:checked'), function(i, n){

	gids.push( $(n).val() );

});

return gids;

}

</script>



    



<include file="Public:footer" />

